<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"	uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>공지 사항</h1>
<body>
<form>
<input type="hidden" value="1" name="contentGroup">
	<table border="2" cellspacing="0" width="850" cellpadding="10px" bgcolor="#fffafa">
		<tr bgcolor="lightblue">
			<td width="700" align="center" colspan="2">제목</td>
			<td width="100">작성일</td>
			<td width="50">조회수</td>
		</tr>
		<c:forEach items="${requestScope.paging.list}" var="noti" varStatus="i">
		<tr>
			<td width="30">
				${i.count} &nbsp; 
			</td>
			<td>
				<a href="/${initParam.context_root}/boardContentNoti.do?no=${noti.no}&page=${requestScope.paging.pagingDTO.currentPage}"><b>${noti.title}</b></a>
			</td>
			<td>
				${noti.writedate}
			</td>
			<td>
				${noti.viewcount }
			</td>
		</tr>
		</c:forEach>
	</table>
	<c:if test="${sessionScope.adminDTO.id!=null}">
		<a href="/${initParam.context_root}/board_write_tiles.do">글 쓰기</a>
	</c:if>
</form>

<c:choose>
	<c:when test="${requestScope.paging.pagingDTO.previousPageGroup==true}">
		<a href="/${initParam.context_root}/selectBoardByPage.do?page=${requestScope.paging.pagingDTO.startPageOfPageGroup-1}">◀</a>
	</c:when>
	<c:otherwise>◁</c:otherwise>
</c:choose>

<c:forEach begin="${requestScope.paging.pagingDTO.startPageOfPageGroup}" end="${requestScope.paging.pagingDTO.endPageOfPageGroup}" var="i">
	<c:choose>
		<c:when test="${i eq requestScope.paging.pagingDTO.currentPage}">
			${i}
		</c:when>
		<c:otherwise>
			<a href="/${initParam.context_root}/selectBoardByPage.do?page=${i}&contentGroup=1">${i}</a>
		</c:otherwise>
	</c:choose>
</c:forEach>

<c:choose>
	<c:when test="${requestScope.paging.pagingDTO.nextPageGroup==true}">
		<a href="/${initParam.context_root}/selectBoardByPage.do?page=${requestScope.paging.pagingDTO.endPageOfPageGroup+1}&contentGroup=1">▶</a>
	</c:when>
	<c:otherwise>▷</c:otherwise>
</c:choose>

<hr>
</body>
</html>